package com.itheima.health.controller;

import com.itheima.health.entity.Result;
import com.itheima.health.service.SetmealService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/setmeal")
@Api(tags = "传智健康预约模块之套餐管理")
public class SetmealController {

    @Reference
    private SetmealService setmealService;

    @GetMapping("findAll")
    @ApiOperation(value = "查询功能",notes = "检查项查询列表信息")
    public Result   findAll(){
        return  new Result(setmealService.list());
    }

    @GetMapping("findSetMealDetail/{id}")
    @ApiOperation(value = "查询功能",notes = "检查项查询列表信息")
    public Result   findSetMealDetail(@PathVariable("id") int id){
        return  new Result(setmealService.findSetMealDetail(id));
    }

    @GetMapping("findSetmealById/{id}")
    @ApiOperation(value = "查询功能",notes = "检查项查询列表信息")
    public Result   findSetmealById(@PathVariable("id") int id){
        return  new Result(setmealService.findSetmealById(id));
    }


}
